Documentation > CMS Template API Library > Input > NextPanel(List[AssetPanelEntry],AssetPanelEntryByRef,ListPanelType,Nullable[Int32],Nullable[Int32],SortOrder,String,Boolean)
NextPanel
Gets the next available panel from the supplied list. Use in the input to loop over a List of AssetPanelEntries which are returned by asset.GetPanelsFromFolder() or panel.GetPanelsFromFolder(). This overload returns an outbound current panel that can be used to get the asset that corresponds with the current list item.
public System.Boolean NextPanel(List[AssetPanelEntry],AssetPanelEntryByRef,ListPanelType,Nullable[Int32],Nullable[Int32],SortOrder,String,Boolean)
Returns
Whether there is an available panel.
Parameters
Name | Description | Type |
---|---|---|
list | The list of AssetPanelEntries to use. | List<AssetPanelEntry> |
currentPanel | The outbound current panel that can be used to get the asset that corresponds with the current list item. | CrownPeak.CMSAPI.AssetPanelEntry& |
type | Optional: Type of list to display. Default is ListPanelType.Regular | CrownPeak.CMSAPI.ListPanelType |
min | Optional: Minimum number of panels (but always at least one). Default is null | Nullable<Int32> |
max | Optional: Maximum number of panels. Default is null | Nullable<Int32> |
sort | Optional: Sort order used for the sorted list type. Must be specified if and only if the type is ListPanelType.Sorted | CrownPeak.CMSAPI.SortOrder |
displayName | Optional: Name to display for the list panel. Not applicable in Classic. Default is null. | System.String |
isAutoIndexed | Optional: Whether the panel handles the list index field automatically. In most cases this should be true, unless another field in the list has the same name as the list. Default is true. | System.Boolean |
Code Example
C#
Sample:
List<AssetPanelEntry> panelEntries = asset.GetPanelsFromFolder("press_releases", type: AssetType.File); AssetPanelEntry currentPanel; while (Input.NextPanel(panelEntries, out currentPanel)) { Input.AddHiddenField("folder_id", currentPanel.ChildAsset.Id); Input.ShowTextBox("Article Display Title", "article_display_title", "", 50); Input.ShowTextBox("Short Description", "article_short_description", "", 50, 5); }